home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / mplus_1.exe / MOUSER.H < prev    next >
C/C++ Source or Header  |  1991-12-01  |  2KB  |  77 lines

  1. /*--------------------------------------------------------------
  2.  *  File:           MOUSER.H
  3.  *  Description:    Defines and function definitions for MPLUS
  4.  *                  mouse routines.
  5.  *
  6.  *  Developed for the MPLUS Graphic Interface Library
  7.  *  Copyright (c) 1989 by Michael Yam
  8.  *-------------------------------------------------------------*/
  9.  
  10. #if !defined(_MPTYPES)
  11. typedef short word;
  12. #define _MPTYPES                /* include only once */
  13. #endif
  14.  
  15. /*      Bit mask values for mouse function 12.
  16.  */
  17. #define _CSRMOVED    0x01
  18. #define _LBPRESSED   0x02
  19. #define _LBRELEASED  0x04
  20. #define _RBPRESSED   0x08
  21. #define _RBRELEASED  0x10
  22. #define _MSALLINT    0x1F
  23.  
  24. /*      Left and right mouse buttons defined
  25.  */
  26. #define MSLBTN          0
  27. #define MSRBTN          1
  28.  
  29. /*      Return values for dev_ready()
  30.  */
  31. #define _KB         1
  32. #define _MS         2
  33.  
  34. /*      Mouse structure
  35.  */
  36. struct ms_status
  37. {
  38.     unsigned int condmask;
  39.     int lbtn;
  40.     int lbpress;
  41.     int lbrelease;
  42.     int rbtn;
  43.     int rbpress;
  44.     int rbrelease;
  45.     word x, y;
  46. };
  47.  
  48. /*      Don't reference these directly unless you have source code.
  49.  *      Use ms_cursor() and ms_reset().
  50.  */
  51. extern char _ms_cursor;                 /* cursor on or off */
  52. extern char _ms_present;                /* any mouse? */
  53.  
  54. /*--------------------------------------------------------------
  55.  *  Function Prototypes
  56.  *-------------------------------------------------------------*/
  57. extern  int mouser(int *m1,int *m2,int *m3,int *m4);
  58. extern  int ms_reset(void);
  59. extern  void ms_showcursor(void);
  60. extern  void ms_hidecursor(void);
  61. extern  int ms_cursor(void);
  62. extern  void ms_getposition(word *x,word *y,int *left,int *right);
  63. extern  void ms_setposition(word x,word y);
  64. extern  int ms_getpress(int button,int *bstatus,int *bpress,word *x,word *y);
  65. extern  int ms_getrelease(int button,int *bstatus,int *brelease,word *x,word *y);
  66. extern  void ms_window(word x1,word y1,word x2,word y2);
  67. extern  void ms_setint(unsigned int mask,unsigned int segment,unsigned int offset);
  68. extern  int ms_poll(struct ms_status *ms_status);
  69. extern  unsigned int ms_ready(void);
  70. extern  void ms_setevent(char flag);
  71. extern  int dev_ready(int *ch,struct ms_status *ms_stat);
  72.  
  73. /*-------------------------------------------------------------*
  74.  *                  End of MOUSER.H                            *
  75.  *-------------------------------------------------------------*/
  76.  
  77.